package main

import (
	"fmt"
	"io"
	"jx3_bot/handler"

	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		Handler(c)
	})
	r.Run(":5700")
}

func Handler(c *gin.Context) {

	r := c.Request.Body
	defer r.Close()

	body, err := io.ReadAll(r)
	if err != nil {
		fmt.Println("<Handler> read response err :", err)
		return
	}
	b := string(body)
	fmt.Println("<Handler> response message :", b)

	handler.HandlerMessage(b)
}
